package com.smart.campus.school.service.impl;

import java.util.List;
import com.smart.campus.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.smart.campus.school.mapper.ApproveListMapper;
import com.smart.campus.school.domain.ApproveList;
import com.smart.campus.school.service.IApproveListService;
import com.smart.campus.common.core.text.Convert;

/**
 * 学生请假审批Service业务层处理
 * 
 * @author Zhihe.Li
 * @date 2020-06-15
 */
@Service
public class ApproveListServiceImpl implements IApproveListService 
{
    @Autowired
    private ApproveListMapper approveListMapper;

    /**
     * 查询学生请假审批
     * 
     * @param id 学生请假审批ID
     * @return 学生请假审批
     */
    @Override
    public ApproveList selectApproveListById(Long id)
    {
        return approveListMapper.selectApproveListById(id);
    }

    /**
     * 查询学生请假审批列表
     * 
     * @param approveList 学生请假审批
     * @return 学生请假审批
     */
    @Override
    public List<ApproveList> selectApproveListList(ApproveList approveList)
    {
        return approveListMapper.selectApproveListList(approveList);
    }

    /**
     * 新增学生请假审批
     * 
     * @param approveList 学生请假审批
     * @return 结果
     */
    @Override
    public int insertApproveList(ApproveList approveList)
    {
        approveList.setCreateTime(DateUtils.getNowDate());
        return approveListMapper.insertApproveList(approveList);
    }

    /**
     * 修改学生请假审批
     * 
     * @param approveList 学生请假审批
     * @return 结果
     */
    @Override
    public int updateApproveList(ApproveList approveList)
    {
        return approveListMapper.updateApproveList(approveList);
    }

    /**
     * 删除学生请假审批对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteApproveListByIds(String ids)
    {
        return approveListMapper.deleteApproveListByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除学生请假审批信息
     * 
     * @param id 学生请假审批ID
     * @return 结果
     */
    @Override
    public int deleteApproveListById(Long id)
    {
        return approveListMapper.deleteApproveListById(id);
    }
}
